import service from './ajax/ajaxs.js'
import base from './nozzle/index.js'

// 封装获取验证码的请求函数
export const GetRegisterCode = (parm)=>{
    return service.post(base.getCode,parm)
}
// 封装用户注册账号的请求函数
export const GetRegisterAccount = (parm)=>{
    return service.post(base.getRegister,parm)
}

// 封装用户登录平台的请求函数
export const login = (parm)=>{
    return service.post(base.getLogin,parm)
}
// 封装获取用户组的请求函数
export const GetUserGroup = (parm)=>{
    return service.get(base.getGroup,{params:parm})
}
// 封装添加用户组的请求函数
export const AddUserGroup = (parm)=>{
    return service.post(base.getGroup,parm)
}
// 封装获取通过关键字进行用户组查询的请求函数
export const GetSearchUserGroup = (parm)=>{
    return service.get(base.getSearchGroup,{params:parm})
}

// 封装修改用户组的请求函数
export const UpdateUserGroup = (parm)=>{
    return service.put(base.getGroup+`${parm.id}/`,parm)
}
// 封装删除用户组的请求函数
export const RemoveUserGroup = (id)=>{
    return service.delete(base.getGroup+`${id}/`)
}

export const GetUserClasses = (parm)=>{
    return service.get(base.getClasses,parm)
}

// 封装获取通过关键字进行班级信息查询的请求函数
export const GetSearchClasses = (parm)=>{
    return service.get(base.getSearchClasses,{params:parm})
}
// 封装添加班级信息的请求函数
export const AddUserClasses= (parm)=>{
    return service.post(base.getClasses,parm)
}
// 封装修改用户组的请求函数
export const UpdateUserClasses = (parm)=>{
    return service.put(base.getClasses+`${parm.id}/`,parm)
}

// 封装移除班级信息的请求函数
export const RemoveUserClasses = (id)=>{
    return service.delete(base.getClasses+`${id}/`)
}

export const GetNotActiveStu = (parm)=>{
    return service.get(base.getNotActiveStu,{params:parm})
}
export const ActiveStuAccount  = (parm)=>{
    return service.put(base.getActiveStu,parm)
}
//搜索未激活学生信息,老师信息
export const GetSearchUser = (parm)=>{
    return service.get(base.getSearchUser,{params:parm})
}
//搜索学生信息,type='2'
export const GetSearchStu = (parm)=>{
    return service.get(base.getSearchUser,{params:parm})
}
//获取学生信息
export const GetStu = (parm)=>{
    return service.get(base.getStu,{params:parm})
}
// 封装对于用户(包括老师学生)进行封号处理的请求函数
export const DeactiveUser  = (parm)=>{
    return service.put(base.getDeActiveUser,parm)
}
// 封装获取所有老师信息的请求函数
export const GetTeachersData = (parm)=>{
    return service.get(base.getTeachers,{params:parm})
}

export const GetTypeUser = (parm)=>{
    return service.get(base.getTypeUser,{params:parm})
}

// 封装获取离职老师信息的请求函数
export const GetDepartUser = (parm)=>{
    return service.get(base.getCheckDepartUser,{params:parm})
}
// 封装离职老师信息的请求函数
export const DeprtUser  = (parm)=>{
    return service.delete(base.getDepartUser,{data:parm})
}

// 封装重置用户的密码的请求函数
export const ResettingUserPassword  = (parm)=>{
    return service.put(base.getResettingUser,parm)
}

// 封装添加老师的请求函数
export const AddTeacherData= (parm)=>{
    return service.post(base.getAddTeacher,parm)
}
// 封装修改老师职位的请求函数
export const UpdateUserPosition  = (parm)=>{
    return service.put(base.getUpdateUserPosition,parm)
}

//个人中心
export const UpdateUserDetail = (parm)=>{
    return service.put(base.getUpdateUserDetail,parm)
}
export const GetUserInfo = ()=>{
    return service.get(base.getUserInfo)
}